package com.explorati.design_pattern.hybrid.observermediator;

public class Nobleman extends EventCustomer {

	// 定义平民能够处理的事件级别
	public Nobleman() {
		super(ProductEventType.CLONE_PRODUCT);
		super.addEventType(ProductEventType.EDIT_PRODUCT);
	}

	public void exex(ProductEvent event) {
		Product p = event.getSource();
		// 事件类型
		ProductEventType type = event.getType();
		if (type.getValue() == ProductEventType.CLONE_PRODUCT.getValue()) {
			System.out.println("贵族处理事件：" + p.getName() + "克隆，事件类型=" + type);
		} else {
			System.out.println("贵族处理事件：" + p.getName() + "修改，事件类型=" + type);
		}
	}
}